#pragma once

#include "Command.h"
#include <list>

class CommandRegistry
{
public:
    static CommandRegistry& instance();

    void registerCommand(ICommand* ptr);

    typedef std::list<ICommand*> CommandsList;
    typedef CommandsList::iterator iterator;
    typedef CommandsList::const_iterator const_iterator;
    typedef CommandsList::size_type size_type;
    typedef CommandsList::value_type value_type;

    const_iterator begin() const;
    const_iterator end() const;
    size_type size() const;
    value_type operator[](size_type i) const;
    

    ~CommandRegistry();

private:
    static CommandRegistry* instance_;
    static void killInstance(); 

    CommandsList commands_;
};
